#include <iostream>
#include <opencv2/opencv.hpp>
#include <modules.h>

using namespace cv;
using namespace std;

int lesson8()
{
    string imagePath = "D:/temp/demo.png";
    string windowTitle = "OriginalImage";
    int loadType = 1; //default imread load type is color

    Mat src = imread(imagePath, loadType); // load image as metrics
    if (src.empty())
    {
        printf("couldn't load image\n");
        system("pause");
        return -1;
    }
    imshow(windowTitle, src);
    OpenCV ocv;
    bool sendCallbackfunctionParameter = true;
    ocv.trackbarDemo(src, sendCallbackfunctionParameter);
    //ocv.splitMergeChannel(src);

    waitKey(0); //stop current thread forever
    destroyAllWindows(); // despose all window created above
    //system("pause");
    return 0;
}
